package com.zsrt.java.day20170113.lh.daily.ch02;

import java.math.BigDecimal;
import java.math.RoundingMode;

@ScottSuppressWarning
public class Cal {
	
	public double add(double x,double y){
		
		BigDecimal xx =new BigDecimal(x);
		BigDecimal yy =new BigDecimal(y);
	
		BigDecimal jg=xx.add(yy).setScale(2, RoundingMode.HALF_UP);
		return jg.doubleValue();
	}
	
	@Deprecated
	public int add(int x,int y){
		int sum=x+y;
		return sum;
	}

}
